<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Request_manage extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->model("customer_friend_model", "friend_model");
	}
	
	
	
	public function index()
	{
		$data = array(
				"rows"=>$this->friend_model->get_all_req()
				);
				
		$this->load->view("functionEntry/requestManage/requestManage", $data);
	}
	

	
	public function send_request($myUid, $friendUid)
	{
		$this->friend_model->add_req_to_db($myUid, $friendUid);
		
		jump_to_last_page();
	}
	


	
	public function accept($accepted, $req_uid)
	{
		if($accepted)
		{
			$this->friend_model->accept_friend_req($req_uid);

		}
		else
		{
			$this->friend_model->deny_friend_req($req_uid);
		}
		
		jump_to_last_page();
	}
}
?>